async function authMiddleware(ctx, next) {
	try {
		ctx.state.user = util.decodeToken(ctx);
	} catch (error) {
		return util.fail(ctx, `认证失败: ${error.message}`);
	}
	await next();
}

module.exports = {
	authMiddleware,
};
